package main

import (
	"fmt"
	// "strconv"
	"bytes"
	"encoding/json"
)

type AA struct {
	aa map[int]string
}

type BB struct {
	bb [4]int
}

type JJ struct {
	CC []*DD
}

type DD struct {
	AA map[int]string
}

func main() {
	fmt.Println("start")
	// a = make([][][]int)
	var a = [][][]int{{{0, 0}, {1, 2}}, {{2, 4}, {3, 6}}, {{4, 8}, {12, 10}}}
	fmt.Println(a, len(a))

	var b map[int][][]int
	b = make(map[int][][]int)

	for k, v := range a {
		b[k] = make([][]int, 0)
		b[k] = v
	}
	fmt.Println(b)
	fmt.Println("aasaaaa")
	var amap map[string]AA

	// aa := AA{aa: {"aa": as}}
	aa := new(AA)
	aa.aa = make(map[int]string)
	aa.aa[1] = "asdasd"
	amap = make(map[string]AA)
	amap["aa"] = *aa
	fmt.Println("1111", aa, amap)
	aa.aa[2] = "1111"
	aa.aa[1] = "1111"
	fmt.Println("222", aa, amap)

	arr := [...]int{1, 2, 3, 4, 5}
	s := [...][2]string{{"a", "b"}, {"c", "d"}}
	// test = make([][][]int, 3)
	// test1 := [...][2][2]int{{{1, 2}, {3, 4}}, {{3, 4}, {6, 7}}, {{11, 12}, {13, 14}}}

	var test [][][]int

	for i := 0; i < 5; i++ {
		var tmpArr [][]int
		for j := 0; j < 3; j++ {
			var tmpArr_tmp []int
			for k := 0; k < 3; k++ {
				tmpArr_tmp = append(tmpArr_tmp, k)
			}
			tmpArr = append(tmpArr, tmpArr_tmp)
		}
		test = append(test, tmpArr)
	}
	fmt.Println("test:", s, arr, test)
	fmt.Println(float64(1) / float64(2))

	fmt.Println(a, fmt.Sprintf("%d", a))

	var bbb BB
	bbb.bb = [4]int{1, 2, 3, 4}
	fmt.Print(bbb)

	// aa := AA{aa: {"aa": as}}
	dd := new(DD)
	dd.AA = make(map[int]string)
	dd.AA[1] = "asdasd"
	dd.AA[2] = "111111111111"

	fmt.Println(dd)
	result, _ := json.Marshal(dd)

	fmt.Println(bytes.NewBuffer([]byte(result)))
}
